home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Disc 39
/
Commodore_Disc_39_19xx_-_de.d64
/
18 uhren
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
9KB
|
465 lines
10 rem******************
20 rem* 18 uhren ***
30 rem* ein programm ***
40 rem* fuer den c64 ***
50 rem* ***
60 rem* von ***
70 rem* g. kramer ***
80 rem* ***
90 rem******************
100 gosub200
110 gosub720
120 gosub1350
130 ifs=0then160
140 gosub2610
150 s=0:goto110
160 end
170 rem******************
180 rem* anfangswerte ***
190 rem******************
200 poke53281,0:poke53280,0
210 printchr$(147)
220 b=1024:f=55296
230 a=rnd(-ti)
240 dimz(17,2),k(7,1),v(7,4)
250 dimr(11),s(4)
260 dimzm(17),km(7),sm(4)
270 a=peek(61)+256*peek(62)
280 poke65,aand255:poke66,a/256
290 fori=0to5
300 readr(i):r(i+6)=-r(i):next
310 data-80,-79,-38,2,42,81
320 a=peek(61)+256*peek(62)
330 poke65,aand255:poke66,a/256
340 fori=0to7:forj=0to4
350 readv(i,j):nextj,i
360 return
370 data0,1,3,4,6,6,3,4,7,7
380 data2,1,4,5,4,8,4,5,7,5
390 data9,10,12,13,2,15,12,13,16,3
400 data11,10,13,14,0,17,13,14,16,1
410 rem*********************
420 rem* zeilen loeschen ***
430 rem*********************
440 fori=atoa0
450 poke781,i:sys59903:next
460 return
470 rem*******************
480 rem* grundstellung ***
490 rem*******************
500 a=peek(61)+256*peek(62)
510 poke65,aand255:poke66,a/256
520 fori=0to17
530 z(i,0)=0
540 readz(i,1)
550 ifi>7then580
560 k(i,0)=0
570 readk(i,1)
580 next:return
590 data123,246,129,486,135,252
600 data363,492,369,266,375,506
610 data603,272,609,512,615,143
620 data149,155,383,389,395,623
630 data629,635
640 rem*******************
650 rem* cursor setzen ***
660 rem*******************
670 poke214,ze:poke211,sp
680 sys58640:return
690 rem***************
700 rem* titelbild ***
710 rem***************
720 a0$=chr$(113)+chr$(113)+chr$(113)
730 a1$=chr$(113)+chr$(32)+chr$(32)
740 a1$=a1$+chr$(32)+chr$(113)
750 a2$=chr$(117)+chr$(99)+chr$(105)
760 a3$=chr$(98)+chr$(18)+chr$(123)
770 a3$=a3$+chr$(146)+chr$(98)
780 a4$=chr$(106)+chr$(99)+chr$(107)
790 printchr$(147)
800 fori=1to3:forj=0to4
810 ifj=0thena5$=chr$(156)+a0$
820 ifj=1thena5$=chr$(156)+a1$
830 ifj=4thena5$=chr$(156)+a0$
840 fork=0to5
850 a=1:if(j=0)or(j=4)thena=2
860 ifk>0thena=a+(a-1)
870 ifk=3thena=a+2
880 printspc(a)a5$;
890 next:print
900 next:print:next
910 printchr$(150)
920 fori=99to739step40
930 pokef+i,13:pokeb+i,66
940 next
950 fori=760to798
960 pokef+i,13:pokeb+i,64
970 next
980 pokeb+779,113
990 printchr$(19):print:print:print
1000 print:fori=0to1:fork=0to2
1010 forj=0to3
1020 a5$=a2$
1030 ifk=1thena5$=a3$
1040 ifk=2thena5$=a4$
1050 a=5:ifj>0thena=3
1060 ifj=2thena=11
1070 printspc(a)a5$;:next
1080 print:next
1090 print:print:print
1100 next
1110 sp=15:ze=20:gosub670
1120 printchr$(154)"18 uhren":print
1130 printtab(11)"ein programm von"
1140 printchr$(158)
1150 printtab(12)"guenter kramer";
1160 geta$:ifa$=""then1160
1170 return
1180 rem********************
1190 rem* anzahl spieler ***
1200 rem********************
1210 a=20:a0=24:gosub440
1220 printchr$(158)chr$(19)
1230 sp=0:ze=20:gosub670
1240 print"bitte eingeben:"
1250 printtab(14)"1 = ein spieler"
1260 printtab(14)"2 = zwei spieler"
1270 poke198,0
1280 geta$:ifa$=""then1280
1290 s=val(a$)
1300 if(s<1)or(s>2)then1280
1310 return
1320 rem**********************
1330 rem* spiel einstellen ***
1340 rem**********************
1350 a=20:a0=24:gosub440:gosub500
1360 fori=0to17
1370 pokef+r(z(i,2))+z(i,1),7
1380 next
1390 printchr$(158)chr$(19)
1400 sp=0:ze=20:gosub670
1410 print"bitte eingeben:"
1420 printtab(14)"f1 = zufallsspiel"
1430 printtab(14)"f3 = grundstellung"
1440 printtab(14)"f5 = spiel laden"
1450 printtab(14)"f8 = spielende";
1460 poke198,0:s=0
1470 geta$:ifa$=""then1470
1480 a=asc(a$):ifa=133then1530
1490 ifa=140then1550
1500 ifa=134then1540
1510 ifa<>135then1470
1520 ei=999:gosub4140:goto1550
1530 gosub1590
1540 gosub1210
1550 return
1560 rem******************
1570 rem* zufallsspiel ***
1580 rem******************
1590 fori0=0to3:i1=int(rnd(0)*2)
1600 ifai1=0theni1=-1
1610 fori2=0toint(rnd(0)*7)
1620 a=i0:a0=i1:gosub1870:nexti2,i0
1630 fori=1to7step2
1640 a=int(rnd(0)*12)
1650 z(i,0)=a
1660 a=int(rnd(0)*12)
1670 z(i+9,0)=a
1680 next
1690 a=int(rnd(0)*12)
1700 z(4,0)=a
1710 a=int(rnd(0)*12)
1720 z(13,0)=a
1730 gosub3370
1740 return
1750 rem*******************
1760 rem* knopf ein/aus ***
1770 rem*******************
1780 k(a,0)=(k(a,0)+1)and1
1790 a1=10:ifk(a,0)=1thena1=7
1800 fori=-1to1:forj=-40to40step40
1810 pokef+k(a,1)+i+j,a1
1820 nextj,i
1830 return
1840 rem******************
1850 rem* knopf drehen ***
1860 rem******************
1870 fori=0to1
1880 z(v(a,0),2)=a0
1890 ifk(a,0)=0then1920
1900 forj=1to3
1910 z(v(a,j),2)=a0:next
1920 a0=a0*-1:a=v(a,4)
1930 next
1940 fori=0to1:forj=0to7
1950 ifk(j,0)=0then2050
1960 a0=0:fork=0to3
1970 a0=z(v(j,k),2)
1980 ifa0<>0thenk=4
1990 next
2000 ifa0=0then2050
2010 z(v(v(j,4),0),2)=-a0
2020 fork=0to3
2030 z(v(j,k),2)=a0
2040 next
2050 nextj,i
2060 fori=0to17
2070 a=z(i,2)
2080 ifa=0then2160
2090 a0=z(i,0):a1=z(i,1)
2100 pokef+a1+r(a0),4
2110 a0=a0+a
2120 ifa0=12thena0=0
2130 ifa0<0thena0=11
2140 pokef+a1+r(a0),7
2150 z(i,0)=a0:z(i,2)=0
2160 next:return
2170 rem*************
2180 rem* eingabe ***
2190 rem*************
2200 ei=0
2210 poke56322,224
2220 a=peek(56320)
2230 ifas=1thena=peek(56321)
2240 poke56322,255
2250 if(aand31)<31then2280
2260 geta$:ifa$=""then2340
2270 ei=asc(a$):goto2330
2280 if(aand1)=0thenei=1
2290 if(aand2)=0thenei=2
2300 if(aand4)=0thenei=3
2310 if(aand8)=0thenei=4
2320 if(aand16)=0thenei=5
2330 poke198,0
2340 return
2350 rem**********************
2360 rem* bildunterschrift ***
2370 rem**********************
2380 a=20:a0=24:gosub440
2390 printchr$(19)chr$(158)
2400 sp=0:ze=20:gosub670
2410 print"f1 = spielstand merken"
2420 print"f3 = spielstand zurueck"
2430 print"f7 = spiel speichern"
2440 print"f8 = spiel abbrechen"
2450 pokef+828,1:pokeb+828,85
2460 fori=829to837
2470 pokef+i,1:pokeb+i,64:next
2480 pokef+838,1:pokeb+838,73
2490 pokef+878,1:pokeb+878,66
2500 pokef+918,1:pokeb+918,66
2510 pokef+958,1:pokeb+958,75
2520 fori=957to949step-1
2530 pokef+i,1:pokeb+i,64:next
2540 pokef+948,1:pokeb+948,74
2550 pokef+908,1:pokeb+908,66
2560 pokef+868,1:pokeb+868,66
2570 return
2580 rem******************
2590 rem* spiel laeuft ***
2600 rem******************
2610 gosub2380:ifei=999then2650
2620 s(1)=0:s(2)=4:s(3)=0:s(4)=0:as=0
2630 as=as+1:ifas>sthenas=1
2640 s(as+2)=s(as+2)+1
2650 a$=str$(s(as+2))
2660 ze=0:sp=17+int(len(a$)/2)
2670 gosub670:printchr$(158)a$
2680 ifs=1then2720
2690 a$=str$(s(3)+s(4))
2700 ze=0:sp=7+20*(as-1)+int(len(a$)/2)
2710 gosub670:printa$
2720 ze=21:sp=29:gosub670
2730 a=153:ifas=2thena=150
2740 printchr$(a)"spieler"as
2750 printtab(31)"joy"as
2760 c=k(s(as),1)
2770 pokeb+c,86
2780 gosub2200
2790 fori=0to50
2800 ifei>0then2850
2810 pokeb+c,91
2820 gosub2200
2830 fori=0to50
2840 ifei=0then2770
2850 pokeb+c,219:a=s(as)
2860 ifei=2then2990
2870 ifei=1then3040
2880 ifei=3thena0=-1:goto2960
2890 ifei=4thena0=1:goto2960
2900 ifei=5thengosub1780
2910 ifei=133thengosub3140
2920 ifei=134thengosub3240:goto2650
2930 ifei=136thengosub3820:goto2650
2940 ifei=140then3100
2950 goto2760
2960 gosub1870
2970 ifs=2then2630
2980 goto2640
2990 s(as)=s(as)+1
3000 if(s=2)and(s(as)=4)thens(as)=0
3010 ifs(as)<8then2760
3020 s(as)=0:ifas=2thens(as)=4
3030 goto2760
3040 s(as)=s(as)-1
3050 if(as=2)and(s(as)=3)thens(as)=7
3060 ifs(as)>=0then2760
3070 s(as)=7
3080 if(s=2)thens(as)=3
3090 goto2760
3100 return
3110 rem***********************
3120 rem* spielstand merken ***
3130 rem***********************
3140 fori=0to17
3150 zm(i)=z(i,0)
3160 ifi>7then3190
3170 km(i)=k(i,0)
3180 ifi<5thensm(i)=s(i)
3190 next
3200 am=as:return
3210 rem************************
3220 rem* spielstand zurueck ***
3230 rem************************
3240 fori=0to17
3250 a=z(i,0):z(i,0)=zm(i):zm(i)=a
3260 ifi>7then3300
3270 a=k(i,0):k(i,0)=km(i):km(i)=a
3280 ifi>4then3300
3290 a=s(i):s(i)=sm(i):sm(i)=a
3300 next
3310 a=0:a0=0:gosub440
3320 a=as:as=am:am=a
3330 gosub3370:gosub3450:return
3340 rem*******************
3350 rem* zeiger setzen ***
3360 rem*******************
3370 fori=0to17:a=z(i,1)+f
3380 forj=0to11:a0=4
3390 ifj=z(i,0)thena0=7
3400 pokea+r(j),a0
3410 nextj,i:return
3420 rem********************
3430 rem* knoepfe setzen ***
3440 rem********************
3450 fora=0to7
3460 gosub1790
3470 next:return
3480 rem***********************
3490 rem* abfrage dateiname ***
3500 rem***********************
3510 a=20:a0=24:gosub440
3520 printchr$(19)chr$(156)
3530 sp=0:ze=20:gosub670
3540 printa$
3550 print
3560 print"name der datei?"
3570 a0$="":poke198,0:a0=0
3580 geta$
3590 if(a1$="0")or(a0>0)then3620
3600 ifa$="$"thengosub4410
3610 ifa0$<>""then3780
3620 ifa0=0then3660
3630 ifa$=chr$(20)then3750
3640 ifa$=chr$(13)then3700
3650 ifa$=chr$(32)then3690
3660 ifa$<"."then3580
3670 ifa$<":"then3690
3680 if(a$<"a")or(a$>"z")then3580
3690 a0$=a0$+a$:a0=a0+1
3700 sp=16:ze=22:gosub670
3710 printa0$+chr$(32)
3720 ifa$=chr$(13)then3780
3730 ifa0<16then3580
3740 goto3780
3750 a0=a0-1
3760 a0$=left$(a0$,a0)
3770 goto3700
3780 return
3790 rem*********************
3800 rem* spiel speichern ***
3810 rem*********************
3820 a$="spiel speichern"
3830 a1$="0":gosub3510
3840 open1,8,15
3850 print#1,"s:"+a0$
3860 close1
3870 open15,8,15
3880 open3,8,3,"0:"+a0$+",u,w"
3890 input#15,a0,a$,a1,a2
3900 ifa0=0then4010
3910 close3:close15
3920 printchr$(158)a0;a$;a1;a2
3930 printchr$(156)"abbrechen?[160](j/n)";
3940 poke198,0
3950 geta$
3960 ifa$="j"then4090
3970 ifa$<>"n"then3950
3980 a=23:a0=24:gosub440
3990 ze=23:sp=0:gosub670
4000 goto3870
4010 fori=0to17
4020 print#3,z(i,0):next
4030 fori=0to7
4040 print#3,k(i,0):next
4050 print#3,s:print#3,as
4060 fori=1to4
4070 print#3,s(i):next
4080 close3:close15
4090 gosub2380
4100 return
4110 rem*****************
4120 rem* spiel laden ***
4130 rem*****************
4140 a$="spiel laden"
4150 a1$="1":gosub3510
4160 open15,8,15
4170 open3,8,3,"0:"+a0$+",u,r"
4180 input#15,a0,a$,a1,a2
4190 ifa0=0then4280
4200 close3:close15
4210 printchr$(158)a0;a$;a1;a2
4220 printchr$(156)"abbrechen?[160](j/n)";
4230 poke198,0
4240 geta$
4250 ifa$="j"then4370
4260 ifa$="n"then4140
4270 goto4240
4280 fori=0to17
4290 input#3,z(i,0):next
4300 fori=0to7
4310 input#3,k(i,0):next
4320 input#3,s:input#3,as
4330 fori=1to4
4340 input#3,s(i):next
4350 close3:close15
4360 gosub3370:gosub3450
4370 return
4380 rem************************
4390 rem* name aus directory ***
4400 rem************************
4410 open1,8,0,"$"
4420 get#1,a$,a$
4430 get#1,a$,a$,l$,h$
4440 ifa$=""thenclose1:goto4410
4450 a0$=""
4460 get#1,a$:ifa$=""then4480
4470 a0$=a0$+a$:goto4460
4480 fori=1to16:a$=a$+chr$(32):next
4490 sp=16:ze=22:gosub670
4500 printa$
4510 sp=16:ze=22:gosub670
4520 a=asc(a0$):ifa=18then4430
4530 a0$=right$(a0$,len(a0$)-1)
4540 ifa=32then4520
4550 ifa<>34thenclose1:goto4410
4560 a=asc(right$(a0$,1))
4570 a0$=left$(a0$,len(a0$)-1)
4580 ifa<>34then4560
4590 printa0$
4600 print"ok?[160](j/n)"
4610 poke198,0
4620 geta$:ifa$="n"then4430
4630 ifa$<>"j"then4620
4640 close1:return